#include "config.h"

#ifndef _CD4052_H_
#define	_CD4052_H_

#ifdef  SUPPORT_CD4052

#define  CD4052_INT()     P0DIR &= ~(1<<3);P0PU |= BIT(3); P0DIR &= ~(1<<4);P0PU |= BIT(4);

#define  CD4052A_L()       P0DIR &= ~(1<<3);P0PU |= BIT(3);P03=0;
#define  CD4052A_H()       P0DIR &= ~(1<<3);P0PU |= BIT(3);P03=1;
#define  CD4052B_L()       P0DIR &= ~(1<<4);P0PU |= BIT(4);P04=0;
#define  CD4052B_H()       P0DIR &= ~(1<<4);P0PU |= BIT(4);P04=1;

#define  SELECT_N1()   CD4052A_L();CD4052B_L();
#define  SELECT_N2()   CD4052A_L();CD4052B_H();
#define  SELECT_N3()   CD4052A_H();CD4052B_H();
#define  SELECT_N4()   CD4052A_H();CD4052B_L();
#endif

#endif
